﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;

namespace Flare
{
    public static class glob
    {
        public static string DBConnection;
        public static bool IsFaulted = false;
        public static bool IsCollapsed = false;
        public static PropertyChangedEventHandler PublicPropertyChange = delegate { };

        #region RADMIN
        public static bool radmin_enable_functions
        {
            get
            {
                return System.IO.File.Exists(radmin_exepath);
            }
        }
        public static bool radmin_no_found_show_notice = true;
        public static string radmin_exepath
        {
            get
            {
                return Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\Radmin Viewer 3\Radmin.exe";
            }
        }
        #endregion
        public static IPubFunctionMainWindow kernel { get; set; }
        public static string current_search_string { get; set; }
        public static int? user_id { get; set; }
        public static string user_name { get; set; }
        public static string user_login { get { return System.Environment.UserName; } }
        public static List<string> user_groups { get; set; }
        public static Dictionary<Guid, NetworkEntityStatus> NetworkList = new Dictionary<Guid, NetworkEntityStatus>();

        public static void InsertUpdateJob(Guid _guid, string _area, string _name)
        {
            eInsertUpdateJob(_guid, _area, _name);
        }
        public static delegateInsertUpdateJob eInsertUpdateJob = delegate { };
        public delegate void delegateInsertUpdateJob(Guid _guid, string _area, string _name);

        public static void RemoveUpdateJob(Guid _guid, string _area)
        {
            eRemoveUpdateJob(_guid, _area);
        }
        public static delegateRemoveUpdateJob eRemoveUpdateJob = delegate { };
        public delegate void delegateRemoveUpdateJob(Guid _guid, string _area);
        
        public static delegateNetworkStatusUpdate eNetworkStatusChange = delegate { };
        public delegate void delegateNetworkStatusUpdate(Guid pointID, long? delay, int lost);
        public enum PanicType { db_connect, sql, access, other }
    }

}
